-- msg_monster_appear_stat
-- Create by huanghr
-- 所有的怪物的出现信息

return function(lpc)
    local buffer = Buffer.create(lpc.monster_appear_stat);

    local offset = 1;
    local id = 0;
    local size = Buffer.size(buffer);

    -- 怪物是否出现过的数据
    local monsterAppear = {};

    while (offset <= size) do
        -- 一个怪物出现出现过占1个字节
        local state = Buffer.getu8(buffer, offset);

        if MonsterM.query(id) then
            monsterAppear[id] = { ["state"] = state, }
        end

        -- 继续下一个monster
        id = id + 1;
        offset = offset + 1;
    end

    ME.user.dbase:set("monster_appear_stat", monsterAppear);
end